﻿@model IAclSelector

<div class="adminContent">
	<div class="adminRow">
		<div class="adminTitle">
			@Html.SmartLabelFor(model => model.SubjectToAcl)
		</div>
		<div class="adminData">
			@Html.CheckBoxFor(model => model.SubjectToAcl, new { data_toggler_for = "#pnl-acl" })
			@Html.ValidationMessageFor(model => model.SubjectToAcl)
		</div>
	</div>
	<div class="adminRow" id="pnl-acl">
		<div class="adminTitle">
			@Html.SmartLabelFor(model => model.AvailableCustomerRoles)
		</div>
		<div class="adminData">
			@if (Model.AvailableCustomerRoles != null && Model.AvailableCustomerRoles.Any())
			{
				foreach (var role in Model.AvailableCustomerRoles)
				{
					<div class="custom-control custom-checkbox mb-1">
						<input type="checkbox" name="SelectedCustomerRoleIds" id="customer-role-@role.Value" class="custom-control-input"
								value="@role.Value" @Html.Attr("checked", "checked", role.Selected) />
						<label class="custom-control-label" for="customer-role-@role.Value">@role.Text</label>
					</div>
				}
			}
			else
			{
				<div class="alert alert-warning">
					@T("Admin.Configuration.Acl.NoRolesDefined")
				</div>
			}
		</div>
	</div>
</div>